<?php
/**
 * Created by PhpStorm.
 * User: change
 * Date: 2017/1/5
 * Time: 9:34
 * 检查记录
 */

namespace Library;


class Record
{
    private $id;               //id
    private $item_title;       //检测项目名
    private $cover;            //图片
    private $is_up;            //是否上传
    private $content;          //内容
    private $create_time;      //创建时间
    private $last_time;        //修改时间
    private $reviewed;         //审核结果   1.通过  0.未通过

    public function __construct($id,$item_title,$cover,$content)
    {
        $this->setId($id);
        $this->setItemTitle($item_title);
        $this->setCover($cover);
        $this->setIsUp(empty($cover)?false:true);
        $this->setContent($content);
        $this->setCreateTime(time());
        $this->setLastTime(time());
        $this->setReviewed(0);
    }

    /**
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param mixed $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return mixed
     */
    public function getItemTitle()
    {
        return $this->item_title;
    }

    /**
     * @param mixed $item_title
     */
    public function setItemTitle($item_title)
    {
        $this->item_title = $item_title;
    }

    /**
     * @return mixed
     */
    public function getCover()
    {
        return $this->cover;
    }

    /**
     * @param mixed $cover
     */
    public function setCover($cover)
    {
        $this->cover = $cover;
    }

    /**
     * @return mixed
     */
    public function getIsUp()
    {
        return $this->is_up;
    }

    /**
     * @param mixed $is_up
     */
    public function setIsUp($is_up)
    {
        $this->is_up = $is_up;
    }

    /**
     * @return mixed
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * @param mixed $content
     */
    public function setContent($content)
    {
        $this->content = $content;
    }

    /**
     * @return mixed
     */
    public function getReviewed()
    {
        return $this->reviewed;
    }

    /**
     * @param mixed $reviewed
     */
    public function setReviewed($reviewed)
    {
        $this->reviewed = $reviewed;
    }

    /**
     * @return mixed
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    /**
     * @param mixed $create_time
     */
    public function setCreateTime($create_time)
    {
        $this->create_time = $create_time;
    }

    /**
     * @return mixed
     */
    public function getLastTime()
    {
        return $this->last_time;
    }

    /**
     * @param mixed $last_time
     */
    public function setLastTime($last_time)
    {
        $this->last_time = $last_time;
    }

    /**
     * @return mixed
     * 转换数组
     */
    public function toArray(){
        $data['id'] = $this->getId();
        $data['item_title'] = $this->getItemTitle();
        $data['cover'] = $this->getCover();
        $data['is_up'] = $this->getIsUp();
        $data['content'] = $this->getContent();
        $data['create_time'] = $this->getCreateTime();
        $data['last_time'] = $this->getLastTime();
        $data['reviewed'] = $this->getReviewed();
        return $data;
    }

}